package com.zm.exam.springbootexam.controller;

import com.zm.exam.springbootexam.entry.User;
import com.zm.exam.springbootexam.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class IndexController {
    @RequestMapping(path = "a",produces = MediaType.TEXT_HTML_VALUE +";charset=utf-8")
    public String Index(){
        return "<h1>Hell World.....</h1>";
    }

    @Autowired
    UserMapper userMapper;
    @RequestMapping("queryAllUser")
    public List<User> queryAllUser(){
        List<User> userList = userMapper.selectList(null);
        return userList;
    }

}
